/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view.jPanels;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Gean
 */
@Entity
@Table(name = "predio", catalog = "", schema = "")
@NamedQueries({
    @NamedQuery(name = "Predio.findAll", query = "SELECT p FROM Predio p"),
    @NamedQuery(name = "Predio.findByIdPredio", query = "SELECT p FROM Predio p WHERE p.idPredio = :idPredio"),
    @NamedQuery(name = "Predio.findByNomePredio", query = "SELECT p FROM Predio p WHERE p.nomePredio = :nomePredio"),
    @NamedQuery(name = "Predio.findByUtilizacao", query = "SELECT p FROM Predio p WHERE p.utilizacao = :utilizacao")})
public class Predio implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idPredio")
    private Integer idPredio;
    @Basic(optional = false)
    @Column(name = "NomePredio")
    private String nomePredio;
    @Basic(optional = false)
    @Column(name = "Utilizacao")
    private String utilizacao;

    public Predio() {
    }

    public Predio(Integer idPredio) {
        this.idPredio = idPredio;
    }

    public Predio(Integer idPredio, String nomePredio, String utilizacao) {
        this.idPredio = idPredio;
        this.nomePredio = nomePredio;
        this.utilizacao = utilizacao;
    }

    public Integer getIdPredio() {
        return idPredio;
    }

    public void setIdPredio(Integer idPredio) {
        Integer oldIdPredio = this.idPredio;
        this.idPredio = idPredio;
        changeSupport.firePropertyChange("idPredio", oldIdPredio, idPredio);
    }

    public String getNomePredio() {
        return nomePredio;
    }

    public void setNomePredio(String nomePredio) {
        String oldNomePredio = this.nomePredio;
        this.nomePredio = nomePredio;
        changeSupport.firePropertyChange("nomePredio", oldNomePredio, nomePredio);
    }

    public String getUtilizacao() {
        return utilizacao;
    }

    public void setUtilizacao(String utilizacao) {
        String oldUtilizacao = this.utilizacao;
        this.utilizacao = utilizacao;
        changeSupport.firePropertyChange("utilizacao", oldUtilizacao, utilizacao);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPredio != null ? idPredio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Predio)) {
            return false;
        }
        Predio other = (Predio) object;
        if ((this.idPredio == null && other.idPredio != null) || (this.idPredio != null && !this.idPredio.equals(other.idPredio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "view.jPanels.Predio[ idPredio=" + idPredio + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
